package edu.scau.cxq.gp.common.result;

public enum ResultCode {

  /* 成功状态码 */
  SUCCESS(200, "成功"),
  /* 参数错误 */
//  PARAM_IS_INVALID(1001, "参数无效"),
//  PARAM_IS_BLANK(1002, "参数为空"),
//  PARAM_TYPE_BIND_ERROR(1003, "参数类型错误"),
//  PARAM_NOT_COMPLETE(1004, "参数缺失"),
  /* 用户错误 2001-2999*/
//  USER_NOTLOGGED_IN(2001, "用户未登录"),
//  USER_LOGIN_ERROR(2002, "账号不存在或密码错误"),
//  SYSTEM_ERROR(10000, "系统异常，请稍后重试")
  BAD_REQUEST(400, "请求出错"),
  UNAUTHORIZED(401, "授权失败"),
  FORBIDDEN(403, "拒绝访问"),
  NOT_FOUND(404, "请求错误,未找到该资源"),
  INTERNAL_SERVER_ERROR(500, "服务端错误");

  private Integer code;
  private String message;

  private ResultCode(Integer code, String message) {
    this.code = code;
    this.message = message;
  }

  public Integer code() {
    return this.code;
  }
  public String message() {
    return this.message;
  }
}
